using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //CreateNewMenu();
    }
    protected void Menu1_MenuItemClick(object sender, MenuEventArgs e)
    {
        Label1.Text=Menu1.SelectedValue;
    }
    void CreateNewMenu()
    {
        Menu menu = new Menu();
        menu.Orientation= Orientation.Horizontal;
        MenuItem menuItem = new MenuItem("Home");
        menu.Items.Add(menuItem);
        menuItem = new MenuItem("Search");
        menu.Items.Add(menuItem);
        menuItem = new MenuItem("Products");
        MenuItem menuItem1 = new MenuItem("Books");
        menuItem.ChildItems.Add(menuItem1);
        menuItem1 = new MenuItem("CD-ROM");
        menuItem.ChildItems.Add(menuItem1);
        menu.Items.Add(menuItem);
        menuItem = new MenuItem("Contact Us");
        menu.Items.Add(menuItem);
        this.form1.Controls.Add(menu);
        
    }
}
